﻿<phone:PhoneApplicationPage 
    x:Class="MapABCAPI_WP7.Samples.MapControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:Mapabc="clr-namespace:Com.Mapabc.Maps.Api;assembly=Mapabc.WP7.API"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot x:Name="Pivot"  Title="{StaticResource ApplicationTitle}">
            <!--Pivot item one-->
            <controls:PivotItem Header="功能">
                <Grid Height="653" Name="grid1" Width="457">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="65" />
                        <ColumnDefinition Width="417" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"  />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="0"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="0">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="放大、缩小地图" Tap="ZoomIn"/>
                    </HyperlinkButton>

                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="1"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="1">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="设置地图中心点" Tap="SetCenter" />
                    </HyperlinkButton>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="2"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="2">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="移图方法" Tap="PanBy"  />
                    </HyperlinkButton>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="3"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="3">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="保存地图状态" Tap="SavePosition" />
                    </HyperlinkButton>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="4"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="4">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="设置工具条状态" Tap="setToolBar" />
                    </HyperlinkButton>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="5"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="5">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="是否允许拖动地图" Tap="DragEnabled" />
                    </HyperlinkButton>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="6"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="6">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="是否允许缩放地图" Tap="ZoomEnabled" />
                    </HyperlinkButton>
                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="地图示例">
                <Grid>
                    <Mapabc:MMap x:Name="map"/>
                    <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" x:Name="cont">
                        <Border Background="LightGray" BorderBrush="DarkGray" CornerRadius="10" BorderThickness="3" Height="276" Margin="-205,0,4,-230" Width="247">
                            <StackPanel Orientation="Vertical" Margin="20">
                                <StackPanel.Resources>
                                    <Style x:Name="spTextBlockStyle" TargetType="TextBlock">
                                        <Setter Property="FontWeight" Value="Bold"/>
                                        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
                                        <Setter Property="Foreground" Value="Black" />
                                        <Setter Property="MinWidth" Value="150" />
                                    </Style>
                                </StackPanel.Resources>
                                <!--<TextBlock x:Name="CenterLngX" Text="" Style="{StaticResource spTextBlockStyle}" />-->
                                <!--<TextBlock x:Name="CenterLatY" Text="" Style="{StaticResource spTextBlockStyle}" />-->
                                <Button Content="放大" Height="72" Name="button1" Width="160" Visibility="Collapsed" Click="mapZoomIn"/>
                                <Button Content="缩小" Height="72" Name="button2" Width="160" Visibility="Collapsed" Click="mapZoomOut"/>
                                <TextBox Height="72" Name="mapLngX" Text="116" Width="460" Visibility="Collapsed" />
                                <TextBox Height="72" Name="mapLatY" Text="39" Width="460" Visibility="Collapsed"/>
                                <TextBox Height="80" Name="panX" Text="30" Width="96" Visibility="Collapsed" />
                                <TextBox Height="81" Name="panY" Text="40" Width="97" Visibility="Collapsed" />
                                <Button Content="移图" Height="72" Name="button3" Width="160" Click="mapPanBy" Visibility="Collapsed"/>
                                <Button Content="保存" Height="72" Name="button4" Width="160" Click="mapSavePosition" Visibility="Collapsed"/>
                                <Button Content="返回" Height="72" Name="button5" Width="160" Click="mapReturnToSavedPosition" Visibility="Collapsed"/>
                                <Button Content="隐藏工具条" Height="73" Name="button6" Width="176" Click="setToolBarHide" Visibility="Collapsed"/>
                                <Button Content="显示工具条" Height="73" Name="button7" Width="176" Click="setToolBarShow" Visibility="Collapsed"/>
                                <Button Content="允许拖动" Height="72" Name="button8" Width="160" Click="IsDragEnabledTrue" Visibility="Collapsed" />
                                <Button Content="禁止拖动" Height="72" Name="button9" Width="160" Click="IsDragEnabledFalse" Visibility="Collapsed"/>
                                <Button Content="允许缩放" Height="72" Name="button10" Width="160" Click="IsZoomEnabledTrue" Visibility="Collapsed"/>
                                <Button Content="禁止缩放" Height="72" Name="button11" Width="160" Click="IsZoomEnabledFalse" Visibility="Collapsed"/>
                            </StackPanel>
                        </Border>
                    </Grid>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>